package cn.itsource.controller;

import cn.itsource.domain.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

//用户服务：暴露接口给订单访问
@RestController
public class UserController {
    
    //订单服务来调用这个方法      http://localhost:1020/user/10
    // @GetMapping(value = "/user/{id}" )
    @RequestMapping(value = "/user1/{id}",method = RequestMethod.GET)
    public User getById(@PathVariable("id")Long id){
        //根据id去数据库查询User
        return new User(id, "张三+端口号1020");
    }
}